package com.acheli.rideable.factory;

import com.acheli.registry.event.Debugging;
import com.acheli.registry.keybind.KeyBinding;
import com.acheli.rideable.entites.RideableEntity;
import com.acheli.rideable.entites.ComponentEntity;
import com.acheli.rideable.factory.ACHeliEntitiesFactory;
import com.acheli.rideable.functionLathes.ComponentFL;
import com.acheli.rideable.functionLathes.EntityFLProvider;
import com.acheli.rideable.functionLathes.RideableFL;
import net.minecraft.client.Minecraft;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.client.event.InputEvent;

public class ComponentFactory extends ACHeliEntitiesFactory<ComponentEntity, ComponentFL> {
    public ComponentFactory(ComponentEntity entity, RideableEntity rideable, ComponentFL lathe) {
        super(entity, new Func(lathe));
    }

    private static class Func extends EntityFLProvider<ComponentEntity, ComponentFL> {
        public Func(ComponentFL lathe) {
            super(lathe);
        }
        @Override
        public void interact(Player player, InteractionHand hand) {
            if (getFL() instanceof ComponentFL && player instanceof LocalPlayer) {
                Minecraft
                        .getInstance().player
                        .sendSystemMessage(Component.literal(
                                "Focus on ID: " + getFL().ID
                        ));
                Debugging.testing = new double[]{0, 0, 0};
                Debugging.cflPointer = getFL();
            }
            getFL().interact(player, hand);
        }
    }


}
